// <div class="img" style="display:none;">
//   <img id="img1" src="../../static/icon/aspjzy-10006.png" alt="">
//   <img id="" src="../../static/icon/aspjzy-10015.png" alt="">
//   <img id="" src="../../static/icon/aspjzy-10018.png" alt="">
// </div>
// <canvas id="canvas1" width="250" height="300" style="border:1px solid #d3d3d3;">
// 您的浏览器不支持 HTML5 canvas 标签。</canvas>
// <img id="imgId" src="" />

export default class Canvas {
  static canvasToImg () {
    let image = document.getElementById('img1');
    let canvas = document.getElementById('canvas1');
    let context = canvas.getContest('2d');
    console.log('context', context);
    console.log('canvas.getContext', canvas.getContext('2d'));

    canvas.getContext('2d').drawImage(document.getElementById('img2'), 0, 0);
    canvas.getContext('2d').drawImage(image, 0, 0);
    canvas.getContext('2d').font = '30px Arial';
    canvas.getContext('2d').fillStyle = 'red';
    canvas.getContext('2d').fillText('aaaaaaaaaa', 20, 50);

    let imgSrc = document.getElementById('canvas1').toDataURL('image/png');
    document.getElementById('imgId').src = imgSrc;
  }
}
